/*
 * generates a random AttackDrone
 */

package item.drone;

import java.util.Random;

import item.weapon.RandomWeapon;
import item.weapon.Weapon;

public class RandomAttackDrone {
	
	//generates a random AttackDrone 
	
	public static AttackDrone random(int level) 
	{
		if(level < 9)
			return null;
		
		Random r = new Random();
		
		Weapon weapon = RandomWeapon.random(level - 9);
		int weight = r.nextInt(10) + 5 * level;
		
		int cost = level * 10 - weight + weapon.cost + 100;
		
		AttackDrone drone = new AttackDrone(cost, level, weight);
		drone.equip(weapon);
		
		return drone;
	}//end of method random
	
}//end of class RandomAttackDrone
